import { defHttp } from '/@/utils/http/axios';
enum Api {
  list = '/api-rpa/variable/list',
  delete = '/api-rpa/variable/delete',
  save = '/api-rpa/variable/save',
}
/**
 * 列表
 * @param params
 */
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
 * 删除
 * @param params
 */
export const deleteVariable = (params, handleSuccess) => {
  return defHttp.post({ url: Api.delete, params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess();
  });
};
/**
 * 保存或者更新全局变量
 * @param params
 */
export const saveOrUpdateVariable = (params) => {
  const url = Api.save;
  return defHttp.post({ url: url, params });
};